package com.huonan.utils;

public class DelHtmlUtils {

    public static String delHTMLTag(String htmlStr){

        String ppp = "<p>()";
        String p_p_p = "()</p>";

        String regEx_script="<script[^>]*?>[\\s\\S]*?<\\/script>";
        String regEx_style="<style[^>]*?>[\\s\\S]*?<\\/style>";
        String regEx_html="<[^>]+>";
        String regEx_space = "\\n";

        htmlStr = htmlStr.replaceAll(ppp, "");
        htmlStr = htmlStr.replaceAll(p_p_p, "   ");

        htmlStr = htmlStr.replaceAll(regEx_script, "");
        htmlStr = htmlStr.replaceAll(regEx_style, "");
        htmlStr = htmlStr.replaceAll(regEx_html, "");
        htmlStr = htmlStr.replaceAll(regEx_space, "");

        return htmlStr.trim();
    }
}
